home *** CD-ROM | disk | FTP | other *** search
- .KF:kbd.toc
- .R:E
- .W:96
- .H:...DML KBD UNIT Version 1.00...
- .H:...$$Day Mon D, YEAR$$ $$Z:MI A.M.$$ Page $$$...
- .H:
- .F:
- .F:... Copyright (c) 1989, by DML Software Inc. ...
- .X:8
-
- .K:KEYBOARD ROUTINES - CHANGES HIGHLIGHTS (VERSION 1.00)
- KEYBOARD ROUTINES - CHANGES HIGHLIGHTS (VERSION 1.00)
-
- 1/1/89 Initial Release
-
-
- .K:1) GENERAL PURPOSE KEYBOARD
- 1) GENERAL PURPOSE KEYBOARD
-
- NAME
- .K:KbdGetStatus - Gets the Keyboard status flags.
- KbdGetStatus - Gets the Keyboard status flags.
-
- SYNOPSIS
- FUNCTION KbdGetStatus : WORD;
-
- WRITELN('All the keyboard flags: ',W2S(KbdGetStatus,'HHHH'));
-
- DESCRIPTION
- This function returns the keyboard shift status in the record of
- booleans describing each status. The record structure is defined in
- root.xxx. The value of the function is an integer, the 16 bits of
- which describe which status is TRUE. The keyboard status is returned
- by accessing the two key-board flag bytes within the BIOS
- communication area. The possible bit settings are:
-
- Bit Position Description
- ------------ --------------------------
- 15 Insert state is active
- 14 Caps Lock key toggled
- 13 Num Lock key toggled
- 12 Scroll Lock key toggled
- 11 Alt shift key depressed
- 10 Ctrl shift depressed
- 09 Left shift key depressed
- 08 Right shift depressed
- 07 Ins key depressed
- 06 Caps Lock key depressed
- 05 Num Lock key depressed
- 04 Scroll Lock depressed
- 03 Suspend state toggled
- 02 SysReq depressed & held (AT only)
- 01 Not Used
- 00 Not Used
-
- SEE ALSO
- KbdInsModeStatus, KbdCapsLockStatus, KbdNumLockStatus,
- KbdScrollLockStatus
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdSetInsMode - Sets the Insert Mode toggle.
- KbdSetInsMode - Sets the Insert Mode toggle.
-
- SYNOPSIS
- PROCEDURE KbdSetInsMode (InsMode : BOOLEAN);
-
- KbdSetInsMode (ON);
-
- DESCRIPTION
- Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE. This
- routine is the equivalent of pressing the key manually on the keyboard.
-
- SEE ALSO
- KbdInsModeStatus
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdSetCapsLock - Sets the Caps Lock toggle.
- KbdSetCapsLock - Sets the Caps Lock toggle.
-
- SYNOPSIS
- PROCEDURE KbdSetCapsLock (CapsLock : BOOLEAN);
-
- KbdSetCapsLock (ON);
-
- DESCRIPTION
- Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE. This
- routine is the equivalent of pressing the key manually on the keyboard.
-
- SEE ALSO
- KbdCapsLockStatus
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdSetNumLock - Sets the Number Lock toggle.
- KbdSetNumLock - Sets the Number Lock toggle.
-
- SYNOPSIS
- PROCEDURE KbdSetNumLock (NumLock : BOOLEAN);
-
- KbdSetNumLock (OFF);
-
- DESCRIPTION
- Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE. This
- routine is the equivalent of pressing the key manually on the keyboard.
-
- SEE ALSO
- KbdNumLockStatus
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdSetScrollLock - Sets the Scroll Lock toggle.
- KbdSetScrollLock - Sets the Scroll Lock toggle.
-
- SYNOPSIS
- PROCEDURE KbdSetScrollLock (ScrollLock : BOOLEAN);
-
- KbdSetScrollLock (OFF);
-
- DESCRIPTION
- Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE. This
- routine is the equivalent of pressing the key manually on the keyboard.
-
- SEE ALSO
- KbdScrollLockStatus
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdInsModeStatus - Returns the state of the Insert Mode toggle.
- KbdInsModeStatus - Returns the state of the Insert Mode toggle.
-
- SYNOPSIS
- FUNCTION KbdInsModeStatus : BOOLEAN;
-
- If KbdInsModeStatus THEN PrintMessage;
-
- DESCRIPTION
- KbdInsModeStatus will have the value TRUE if the Insert toggle is on.
-
- SEE ALSO
- KbdSetInsMode
-
- DEPENDS ON
- KbdGetStatus
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdCapsLockStatus - Returns the state of the keyboard Caps Lock flag.
- KbdCapsLockStatus - Returns the state of the keyboard Caps Lock flag.
-
- SYNOPSIS
- FUNCTION KbdCapsLockStatus : BOOLEAN;
-
- IF KbdCapsLockStatus THEN PrintMessage;
-
- DESCRIPTION
- KbdCapsLockStatus will have the value TRUE if the Caps Lock flag is on.
-
- SEE ALSO
- KbdSetCapsLock
-
- DEPENDS ON
- KbdGetStatus
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdNumLockStatus - Returns the state of the Number lock flag.
- KbdNumLockStatus - Returns the state of the Number lock flag.
-
- SYNOPSIS
- FUNCTION KbdNumLockStatus : BOOLEAN;
-
- IF KbdNumLockStatus THEN PrintMessage;
-
-
- DESCRIPTION
- KbdNumLockStatus will have the value TRUE if the Number Lock flag is on.
-
- SEE ALSO
- KbdSetNumLock
-
- DEPENDS ON
- KbdGetStatus
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdScrollLockStatus - Returns the state of the Scroll lock flag.
- KbdScrollLockStatus - Returns the state of the Scroll lock flag.
-
- SYNOPSIS
- FUNCTION KbdScrollLockStatus : BOOLEAN;
-
- If KbdScrollLockStatus THEN PrintMessage;
-
- DESCRIPTION
- KbdScrollLockStatus will have the value TRUE if Scroll lock is on.
-
- SEE ALSO
- KbdSetScrollLock
-
- DEPENDS ON
- KbdGetStatus
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- .K:2) KEYBOARD BUFFER
- 2) KEYBOARD BUFFER
-
- NAME
- .K:KbdClear - Clears the keyboard buffer.
- KbdClear - Clears the keyboard buffer.
-
- SYNOPSIS
- PROCEDURE KbdClear;
-
- REPEAT
- UNTIL KeyPressed;
- KbdClear;
-
- DESCRIPTION
- This procedure flushes the keyboard buffer, that is, all remaining
- keystrokes are removed from the buffer. It does no damage to flush an
- empty buffer. The buffer is flushed by making a call to DOS function 0C
- (hex).
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdNumValuesWaiting - Returns the number of keys waiting in the keyboard.
- KbdNumValuesWaiting - Returns the number of keys waiting in the keyboard
- buffer.
-
- SYNOPSIS
- FUNCTION KbdNumValuesWaiting : INTEGER;
-
- IF KbdNumValuesWaiting > 10 THEN ReadKeyboard;
-
- DESCRIPTION
- The BIOS does not support this function. The data locations for the head
- and tail pointers for the keyboard buffer are known, and the number of keys
- in the buffer is calculated from them.
-
- SEE ALSO
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdInputValue - Waits for and returns "scan code" of a key pressed.
- KbdInputValue - Waits for and returns "scan code" of a key pressed.
-
- SYNOPSIS
- FUNCTION KbdInputValue : WORD;
- VAR
- KbdLastChar : CHAR;
-
- CASE KbdInputValue OF
- K_Esc : Abort;
- 'A'..'Z' : WRITELN ('You pressed: ', KbdLastChar);
- END;
-
- DESCRIPTION
- KbdInputValue will wait for a key to be pressed. If you don't want to
- wait it is suggested that you use KbdKeyWaiting in a repeat loop before
- you call this procedure. The value returned will simply be the ASCII
- value unless a special key (Function keys, cursor, etc) was pressed in
- which case the returned value will be 256 plus the IBM extended code.
- Included in this file are constant values for all the unique special
- keys allowed by the BIOS. In addition, there is a special initialized
- constant called KbdLastChar which contains the last normal key pressed.
- If the last key pressed was a special key then KbdLastChar will contain
- the value zero.
-
- SEE ALSO
- KbdKeyWaiting
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
- ReadKey
-
- UPDATE HISTORY
-
-
-
- NAME
- .K:KbdKeyWaiting - Returns TRUE if a key is in the keyboard buffer.
- KbdKeyWaiting - Returns TRUE if a key is in the keyboard buffer.
-
- SYNOPSIS
- FUNCTION KbdKeyWaiting : BOOLEAN;
-
- REPEAT
- ProcedureCalls;
- UNTIL KbdKeyWaiting;
-
- DESCRIPTION
- This routine uses the BIOS function call to determine if there are any
- keys waiting in the buffer. It is very similar to the Turbo function
- KeyPressed.
-
- SEE ALSO
- KbdInputValue
-
- DEPENDS ON
-
- DIAGNOSTICS
-
- KNOWN RESTRICTIONS
-
- PARTIALLY OBSOLETED BY
- KeyPressed
-
- UPDATE HISTORY
-
-
-
-